package com.llkj.qingnianguoxue.mine.mycoin;

import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;

import com.llkj.qingnianguoxue.R;
import com.llkj.qingnianguoxue.adapter.WinningRuleAdapter;
import com.llkj.qingnianguoxue.base.BaseActivity;
import com.llkj.qingnianguoxue.bean.WinningRuleBean;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * 抽奖规则
 */
public class WinningRuleActivity extends BaseActivity {

    @BindView(R.id.rvRule)
    RecyclerView mRvRule;
    private WinningRuleAdapter mRuleAdapter;
    private List<WinningRuleBean> mRuleData;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_winning_rule);
        setTitle("抽奖规则", true, TITLE_TYPE_IMG, R.drawable.icon_back, false, -1, -1);
        ButterKnife.bind(this);

        initView();
    }

    private void initView(){
        initStatusbar(TSATUSBAR_TYPE_BLACK_TEXT,rlTitle,R.color.gray_bar);
        mRvRule.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.VERTICAL,false));
        mRuleData = new ArrayList<>();
        initData();
        mRuleAdapter = new WinningRuleAdapter(R.layout.item_winning_rule,mRuleData);
        mRvRule.setAdapter(mRuleAdapter);
    }

    private void initData(){
        WinningRuleBean ruleBean = new WinningRuleBean();
        ruleBean.setRuleTitle("抽奖形式");
        ruleBean.setRuleDescription("1、活动时间\n2018年1月1日——2018年21月31日。\n2、参与规则\n太平洋汽车网注册用户\n用户登录客户端并成功签到");
        mRuleData.add(ruleBean);
        ruleBean = new WinningRuleBean();
        ruleBean.setRuleTitle("奖项设置");
        ruleBean.setRuleDescription("1、活动时间\n2018年1月1日——2018年21月31日。\n2、参与规则\n太平洋汽车网注册用户\n用户登录客户端并成功签到");
        mRuleData.add(ruleBean);
        ruleBean = new WinningRuleBean();
        ruleBean.setRuleTitle("中奖说明");
        ruleBean.setRuleDescription("1、活动时间\n2018年1月1日——2018年21月31日。\n2、参与规则\n太平洋汽车网注册用户\n用户登录客户端并成功签到");
        mRuleData.add(ruleBean);
    }
}
